﻿@using MoviesRoom.Areas.Administration.ViewModels

@{
    ViewBag.Title = "Votes";
}

<h2>@ViewBag.Title</h2>

@(Html.Kendo()
      .Grid<VotesViewModel>()
      .Name("GridComments")
      .Columns(c =>
      {
          c.Bound(m => m.Id).Visible(false);
          c.Bound(m => m.UserName);
          c.Bound(m => m.FilmName);
          c.Bound(m => m.Value);
          c.Command(cmd =>
          {
              cmd.Destroy();
          }).Title("Action");
      })
      .DataSource(data =>
      {
          data.Ajax()
              .PageSize(10)
              .ServerOperation(true)
              .Model(x => x.Id(m => m.Id))
              .Read("ReadVotes", "AdminVotes")
              .Destroy("DeleteVotes", "AdminVotes");
      })
      .Filterable()
      .Pageable()
      .Sortable())
    
@section Kendo {
    @Styles.Render("~/Content/Kendo/css")
    @Scripts.Render("~/bundles/kendo");
}